<html>
<head>
</head>
<body>
<div id="tabcontent" >
<h1><?php echo $form_caption; ?>
</h1>
<div class='toolbar ui-widget-header ui-corner-all'>
<a href='<?php echo site_url();?>/master/cagama/' class='link_list'>Daftar agama</a>
</div>
<?php
  echo $add_info;	
  echo "<br>";
  echo form_open($action);
?>
<table width="826" align="left">
<tr>
  <td width="130">Nama</td>
  <td width="334"><input name="nama" type='text' id="nama" size="35" value="<?php echo $agama->nama_agama; ?>"></td>
</tr>
<tr>
  <td width="130">Hapus</td>
  <td width="334">
  <?php echo select_hapus(); ?>
  </td>
</tr>
<tr>
  <td>&nbsp;</td>
  <td><input type="submit" name="Submit" value="<?php echo $btn_caption; ?>">
  <input type="hidden" name="id_agama" value="<?php echo $agama->id_agama; ?>">  
  </td>
  <td>&nbsp;</td>
  <td>&nbsp;</td>
</tr>
</table>
<?php
form_close();
?>
</div>
<Script language="javascript">
jQuery(document).ready(function(){
	$("#tanggal").datepicker({dateFormat:"dd/mm/yy",altField:"#tanggal_file",altFormat:"yy-mm-dd",changeMonth:true,changeYear:true});
	
	LoadRoleAutoComplete(_base_url,"#role","#h_role");
});


function LoadRoleAutoComplete(_base_url,idtext,idhidden) {
	
	$(idtext).autocomplete(_base_url + "/index.php/agama/xrole/get_role", 
	{
		dataType : "json",
		formatItem: false,
		retrieveComplete : function(data){
			if(data!="0"){
				return data;
			}
		},
		
		onItemSelect : function(li, row) {
			$(idhidden).val(row[1]);	
		}
	});
}

</Script>
</body>
</html>
